$(function(){
	$('#send_email').click(function(e){
		e.preventDefault();
		$('.loader').show();
		$.ajax({
			url: $(this).attr('href'),
			type: 'post',
			data:{
				period:$('#period').val(),
				general_date:$('#general_date').val(),
				week_start_value:$('.week_start_value').val(),
				week_end_value:$('.week_end_value').val()
			},
			success: function(response){
				$('.loader').hide();
			}
		});
	});
}); 

function ra_pagination_init()
{
	$(".ra_pagination").pagination(ra_num_entries, {
        num_edge_entries: ra_num_edge_entries,
		num_display_entries: 5,
        callback: function(idx, jq) {
			$.ajax({
				url: 'admin/recent_act/' + idx,
				type: 'post',
				success: function(response) {
					$('#ra_div').html(response);
				}
			});
		},
        items_per_page: ra_items_per_page
    });
}

function rs_pagination_init()
{
	$(".rs_pagination").pagination(rs_num_entries, {
        num_edge_entries: rs_num_edge_entries,
		num_display_entries: 5,
        callback: function(idx, jq) {
			$.ajax({
				url: 'admin/recent_sales/' + idx,
				type: 'post',
				success: function(response) {
					$('#rs_div').html(response);
				}
			});
		},
        items_per_page: rs_items_per_page
    });
}